<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
</head>
<body>
<h1>我是正儿八经的网站</h1>
<form action="" method="post">
{#    {% csrf_token %}#}
    <p>username:<input type="text" name="username"></p>
    <p>target_user:<input type="text" name="target_user"></p>
    <p>money:<input type="text" name="money"></p>
    <input type="submit">
</form>
<button class="d1">点我</button>
{{ csrf_token }}
<script>
    $('.d1').click(function() {
        $.ajax({
            url: '',
            type: 'post',
            // data: {csrfmiddlewaretoken: $('[name=csrfmiddlewaretoken]').val(), username: 'AK', target_user: 'AKW', money:100000},
            // data: {csrfmiddlewaretoken: '{{ csrf_token }}', username: 'AK', target_user: 'AKW', money:100000},
            data: { username: 'AK', target_user: 'AKW', money:100000},
            success: function(data) {
                console.log(data, typeof data);
            }
        })
    })
</script>
</body>
</html>